.SUFFIXES:
.SUFFIXES:.c .o .a .so .out

SRC =     analysis.c \
          main.c volatile.c\


CC       =gcc
CFLAG    =-c -g -Wall -pg
DFLAG    =-shared -fPIC
LFLAG    =-pg

OBJ      =$(patsubst %.c,%.o,$(SRC))
DEPS     =fdependent
inch     =./inc
incs     =./src
INC      =-I$(inch) -I$(incs)
SHELL    =/bin/sh
TARGET   =aiaee.out

vpath %.o ./obj

.PHONY:clean all link

all:$(TARGET)

-include $(DEPS)
$(TARGET):$(OBJ)
	$(MAKE) link

$(OBJ):%.o:%.c
	$(CC) $(CFLAG) $(INC) -o $@ $<
	mv $@ ./obj

$(DEPS):$(SRC)
	$(CC) $(INC) -MM $^ >$@

link:$(OBJ)
	$(CC) $(LFLAG) $(INC) -o $(TARGET) $^

clean:
	-rm -rf $(TARGET) $(DEPS) ./obj/*
